package com.lovo.ssc.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lovo.ssc.entity.SysUser;
import com.lovo.ssc.mapper.SysUserMapper;
import com.lovo.ssc.service.ISysUserService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 登录用户表 服务实现类
 * </p>
 *
 * @author lovo
 * @since 2022-07-07
 */
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {

    @Override
    public SysUser login(String name, String pwd, String grade) {

        QueryWrapper qw = new QueryWrapper();
        qw.eq("name",name);
        qw.eq("pwd",pwd);
        qw.eq("grade",grade);
        return baseMapper.selectOne(qw);
    }

    @Override
    public SysUser findByName(String name) {
        QueryWrapper qw = new QueryWrapper();
        qw.eq("name",name);
        return baseMapper.selectOne(qw);
    }
}
